package net.sareweb.acab.entity;

// Generated 13-abr-2010 15:53:20 by Hibernate Tools 3.2.5.Beta

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.hibernate.validator.NotNull;

/**
 * Suggestion generated by hbm2java
 */
@Entity
@Table(name = "suggestion", catalog = "acab", uniqueConstraints = @UniqueConstraint(columnNames = {
		"request", "suggestionInfo" }))
public class Suggestion implements java.io.Serializable {

	private Integer idSuggestion;
	private Suggestioninfo suggestioninfo;
	private Request request;
	private Date createDate;
	private Date rejectDate;
	private Date seenDate;

	public Suggestion() {
	}

	public Suggestion(Suggestioninfo suggestioninfo, Request request,
			Date createDate) {
		this.suggestioninfo = suggestioninfo;
		this.request = request;
		this.createDate = createDate;
	}

	public Suggestion(Suggestioninfo suggestioninfo, Request request,
			Date createDate, Date rejectDate, Date seenDate) {
		this.suggestioninfo = suggestioninfo;
		this.request = request;
		this.createDate = createDate;
		this.rejectDate = rejectDate;
		this.seenDate = seenDate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idSuggestion", unique = true, nullable = false)
	public Integer getIdSuggestion() {
		return this.idSuggestion;
	}

	public void setIdSuggestion(Integer idSuggestion) {
		this.idSuggestion = idSuggestion;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "suggestionInfo", nullable = false)
	@NotNull
	public Suggestioninfo getSuggestioninfo() {
		return this.suggestioninfo;
	}

	public void setSuggestioninfo(Suggestioninfo suggestioninfo) {
		this.suggestioninfo = suggestioninfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "request", nullable = false)
	@NotNull
	public Request getRequest() {
		return this.request;
	}

	public void setRequest(Request request) {
		this.request = request;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createDate", nullable = false, length = 0)
	@NotNull
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "rejectDate", length = 0)
	public Date getRejectDate() {
		return this.rejectDate;
	}

	public void setRejectDate(Date rejectDate) {
		this.rejectDate = rejectDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "seenDate", length = 0)
	public Date getSeenDate() {
		return this.seenDate;
	}

	public void setSeenDate(Date seenDate) {
		this.seenDate = seenDate;
	}

}
